﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Echiquier
{
    public partial class Form1 : Form
    {
        #region Attributs
        private List<Plateau> _timeLine;

        #endregion

        #region Constructeur
        public Form1()
        {
            InitializeComponent();

            _timeLine = new List<Plateau>();
            for (int n = 0; n < new Random().Next(3,10); ++n)
            {
                Plateau p = new Plateau();

                _timeLine.Add(p);

                Cmbx_TimeLine.Items.Add(p);
            }
        }
        #endregion

        private void Cmbx_TimeLine_SelectedIndexChanged(object sender, EventArgs e)
        {
                for (int i = 0; i < tableLayoutPanel1.RowCount; ++i)
                    for (int j = 0; j < tableLayoutPanel1.ColumnCount; ++j)
                    {
                        Panel panel = new Panel();
                        Plateau p = (Plateau)Cmbx_TimeLine.SelectedItem;
                        panel.BackColor = PionSet.GetSingleton()[p._plateau[i, j]].Color;
                        tableLayoutPanel1.Controls.Add(panel, i, j);
                    }
        }

        #region Proprietes

        #endregion

        #region Methodes
        #endregion
    }
}
